package com.curvebreakers.wheresmystuff.model;

public enum EntryType {
	NOSELECTION ("All Types"),
	LOST ("Lost"),
	FOUND ("Found"),
	DONATION ("Donation"),
	REQUEST ("Request");
	
	String name;
	
	private EntryType(String name) {
		this.name = name;
	}
	
	@Override
	public String toString() {
		return name;
	}
	
	public static EntryType getEntryType(String type) {
		if (type.equals("Lost")) 
			return LOST;
		else if (type.equals("Found"))
			return FOUND;
		else if (type.equals("Donation"))
			return DONATION;
		else
			return REQUEST;
	}
	
	public String toTitleString() {
		if (name.equals("Lost")) 
			return "Lost Item";
		else if (name.equals("Found"))
			return "Found Item";
		else if (name.equals("Donation"))
			return "Donation";
		else
			return "Request";
	}
	
	/**
	 * @return an adjective describing the EntryType
	 */
	public String getAdjective() {
		if (name.equals("Donation"))
			return "Donated";
		else if (name.equals("Request"))
			return "Requested";
		return name;
	}
}
